import java.util.Calendar;
import java.util.GregorianCalendar;

public class problem19 {
    public static void main(String[] args) {
        Calendar calendar = new GregorianCalendar(1901, 1, 1);

        int sumOfSundays = 0;
        do {
            int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
            if (dayOfWeek == Calendar.SUNDAY) {
                sumOfSundays++;
                System.out.println(sumOfSundays + " " + calendar.getTime());
            }
            calendar.add(Calendar.MONTH, 1);
        } while (calendar.get(Calendar.YEAR) < 2001);

        System.out.println(sumOfSundays);
    }
}
